package com.qk.management.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.qk.common.PageResult;
import com.qk.dto.log.OperateLogDTO;
import com.qk.entity.OperateLog;
import com.qk.management.mapper.OperateLogMapper;
import com.qk.management.service.OperateLogService;
import com.qk.vo.log.OperateLogVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * @author: Enid
 * @date: 2025/10/17 17:05
 * @description:
 */
@Slf4j
@Service
@SuppressWarnings("all")
public class OperateLogServiceIml extends ServiceImpl<OperateLogMapper, OperateLog> implements OperateLogService {
    @Autowired
    private OperateLogMapper operateLogMapper;
    @Override
    public PageResult<OperateLogVO> getList(OperateLogDTO dto) {
        PageHelper.startPage(dto.getPage(), dto.getPageSize());
        List<OperateLogVO> list = operateLogMapper.pageList(dto);
        Page<OperateLogVO> page = (Page<OperateLogVO>)list;
        return PageResult.<OperateLogVO>builder()
                .total(Long.valueOf(page.getTotal()).intValue())
                .rows(list)
                .build();
    }
}
